#include<bits/stdc++.h>
using std::cin;
using std::cout;
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
using pii = std::pair<int, int>;
#define TESTS int _; std::cin >> _; while(_--)
#define all(a) a.begin(), a.end()
#define all1(a) a.begin() + 1, a.end()
#define pb push_back
#define fi first
#define se second
#define SUM(v) std::accumulate(all(v), 0LL)
#define SUM1(v) std::accumulate(all1(v), 0LL)
#define MIN(v) *std::min_element(all(v))
#define MIN1(v) *std::min_element(all1(v))
#define MAX(v) *std::max_element(all(v))
#define MAX1(v) *std::max_element(all1(v))
#define UNIQUE(v) std::sort(all(v)), v.erase(std::unique(all(v), v.end()))
#define UNIQUE1(v) std::sort(all1(v)), v.erase(std::unique(all1(v), v.end()))

constexpr i64 inf = 1E18, Md3 = 998244353, Md7 = 1e9 + 7;
constexpr double eps = 1E-9;
// std::mt19937 rng {std::chrono::steady_clock::now().time_since_epoch().count()};

int main() {
	
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
		
	int ans = 0;
	for(int i = 0; i < 12; i++) {
		std::string s;
		std::cin >> s;
		if(s.size() == i + 1) {
			ans++;
		}
	}
	cout << ans;

	return 0;
}